import request from '@/router/axios';

// 查询账户
export const getAccountRechargeRequirement = params => {
  return request({
    url: '/api/beetles-business/account/accountRechargeRequirement/pageByTTTwo',
    method: 'GET',
    params
  })
}

// 拉取用户信息
export const getSelectAccountforTT = params => {
  return request({
    url: '/api/beetles-business/account/select-tt-account',
    method: 'GET',
    params
  })
}
//拉取五家媒体的用户信息
export const getSelectAccountfor = params => {
  return request({
    url: '/api/beetles-business/account/select-account',
    method: 'GET',
    params
  })
}
// 批量新增充值需求
export const saveRequirementByBatch = data => {
  return request({
    url: '/api/beetles-business/account/accountRechargeRequirement/saveByBatch',
    method: 'POST',
    data
  })
}

// 一个账户多条充值记录
export const getRecordById = platformId => {
  return request({
    url: '/api/beetles-business/account/accountRechargeRequirement/list',
    method: 'GET',
    params: {
      platformId
    }
  })
}

// 充值需求列表-媒体运营
export const getAccountRechargeRequirementForOne = params => {
  return request({
    url: '/api/beetles-business/account/accountRechargeRequirement/pageByTTOne',
    method: 'GET',
    params
  })
}

// 获取余额
export const getBCBalance = params => {
  return request({
    url: '/api/beetles-business/account/accountRechargeRequirement/getBCBalance',
    method: 'GET',
    params
  })
}

// 扣款申请
export const saveByBatch = data => {
  return request({
    url: '/api/beetles-business/account/accountRefundRequirement/saveByBatch',
    method: 'POST',
    data
  })
}

// 充值申请
export const saveRechargeByBatch = ids => {
  return request({
    url: '/api/beetles-business/account/accountRechargeRequirement/rechargeByBatch',
    method: 'POST',
    params: {
      ids
    }
  })
}

// 按照更新时间分组全部显示-媒体运营
export const getAccountListByUpdateTime = params => {
  return request({
    url: '/api/beetles-business/account/accountRechargeRequirement/listByUpdateTime',
    method: 'GET',
    params
  })
}

// 获取TT账户余额
export const getTTAccountBalance = platformId => {
  return request({
    url: '/api/beetles-business/account/accountRechargeRequirement/getTTAccountBalance',
    method: 'GET',
    params:{
      platformId
    }
  })
}

// 获取媒体账户-媒体运营
export const getSelectRechargePlatformAccountsByTTOne = params => {
  return request({
    url: '/api/beetles-business/account/accountRechargeRequirement/selectRechargePlatformAccountsByTTOne',
    method: 'GET',
    params
  })
}

//修改金额和优先级
export const updateAmountAndLevel = data => {
  return request({
    url: '/api/beetles-business/account/accountRechargeRequirement/update',
    method: 'post',
    data
  })
}

//预估花费
export const getPredictCost = () => {
  return request({
    url: '/api/beetles-business/account/accountRechargeRequirement/getPredictCost',
    method: 'get',
  })
}

//充值拒绝
export const auditReject = data => {
  return request({
    url: '/api/beetles-business/account/accountRechargeRequirement/auditReject',
    method: 'post',
    data
  })
}
//批量拒绝
export const auditRejectByBatch= (ids) => {
  return request({
    url: '/api/beetles-business/account/accountRechargeRequirement/auditRejectByBatch',
    method: 'post',
    params:{
      ids
    }
  })
}
//充值成功
export const rechargeSuccessfully = ids => {
  return request({
    url: '/api/beetles-business/account/accountRechargeRequirement/rechargeSuccessByBatch',
    method: 'POST',
    params: {
      ids
    }
  })
}
//充值失败
export const failureRecharge = ids => {
  return request({
    url: '/api/beetles-business/account/accountRechargeRequirement/rechargeFailByBatch',
    method: 'POST',
    params: {
      ids
    }
  })
}
